package com.service.atm;

import com.bpms.common.CommonUtil;
import com.bpms.common.VO;
import com.bpms.eai.ISyncComm;
import com.bpms.eai.PackTool;
import com.bpms.esb.IService;
import com.service.uai.engine.comm.AccountQueryClient;

public class Redirect_queryaccount_request extends PackTool implements IService {

	public VO exec(VO args) {
		VO r = new VO();
		try {
			r.voType = "ATM.Redirect_queryaccount_request_answer";			
			String request_message = args.getAttr("data");
			CommonUtil.debug("ATM.Redirect_queryaccount_request request buffer：" + request_message);
			ISyncComm syncComm = new AccountQueryClient();
			
			byte[] buffer = request_message.getBytes("gb2312");			
			byte[] resultBuffer = syncComm.sendBuffer(buffer);
			if (resultBuffer == null) return null;
			
			CommonUtil.debug("ATM.Redirect_queryaccount_request result buffer：" + new String(resultBuffer,"gb2312"));

			r.setAttr("msg", new String(resultBuffer,"gb2312"));

			return r;
		} catch (Exception e) {
			CommonUtil.debug("Parse_queryaccount exception", e);
			return null;
		}

	}

}
